<template>
  <div id="app">
    <div class="inputText">
      <input type="text" placeholder="请输入商品，商家">
    </div>
    <div class="imgbox">
      <img src="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fwww.cdcxhl.com%2Fupload%2Fimage%2F20191128%2F20191128150281888188.jpg&refer=http%3A%2F%2Fwww.cdcxhl.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1668245123&t=9d09590624360d0f0181f51bdf607f04" alt="" srcset="">
    </div>
   <div class="option">
     <h2>猜你喜欢</h2>
     <div class="bigbox">
       <div :class ="{active:currentIndex == index}" @click="fun(index)" class="name" v-for="(item,index) in str" :key="index"> {{item}} </div>
     </div>
     <div class="hei">
        <span class="biao" v-for="(item,index) in stt" :key="index"> {{item}} </span>
     </div>
     <div class="caidan"  v-for="(item,index) in arr" :key="index">
        <div class="imgbox">
            <img :src="item.img" alt="" class="tu">
        </div>
        <div class="jieshao">
            <h3 class="hh"> {{item.hh}} </h3>
            <span class="bin"> {{item.bin}} </span><span class="fenzhong"> {{item.fenzhong}}</span>
            <div class="ss">
                <span class="chao">{{item.chao}}</span>
            </div>
            <div class="manjian">
                <span class="jian"> {{item.jian}} </span><span class="jian1"> {{item.jian}} </span><span class="jian2"> {{item.jian}} </span>
            </div>

        </div>
    </div>
  </div>

  </div>
</template>

<script>
var img1 = "https://img0.baidu.com/it/u=317866587,988618494&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500";
var img2 = "https://img0.baidu.com/it/u=424305162,2088133468&fm=253&fmt=auto&app=138&f=JPEG?w=200&h=200";
export default {
      data(){
        return{
            str:["综合排序","距离最近","销量最高","筛选"],
            
            stt:["年货节热卖","津贴联盟","满减优惠","品质联盟"],
            currentIndex:0,
            con:0,
            arr:[
                {img:img1,hh:"明洞炸鸡(兰岛店)",bin:"起送￥20  远距离配送￥3",fenzhong:"47分钟 3.9km",chao:"快乐炸鸡棒棒",jian:"35减12",jian1:"70减35",jian2:"100减45"},
                {img:img2,hh:"甜品蛋糕(兰岛店)",bin:"起送￥60  远距离配送￥8",fenzhong:"67分钟 10.9km",chao:"甜到你的心里",jian:"35减12",jian1:"70减35",jian2:"100减45"},
            ],
            
            
        }
    },
 
}
</script>

<style lang="scss" scoped>
*{
  margin: 0;padding: 0;
}
.imgbox{
    margin: 6px auto;
    width: 100%;
    height: 150px;
    border-radius: 10px;
    padding: 10px;
    box-sizing: border-box;
}
.imgbox img{
    width: 100%;
    height:150px;
    border-radius: 10px;
}
.inputText{
  width: 100%;
  height: 100px;
  background-color: rgb(64, 134, 226);
  position: relative;
}
.inputText input{
  width: 95%;
  height: 40px;
  border-radius: 20px;
  border: none;
  text-align: center;
  box-sizing: border-box;
  position: absolute;
  outline: none;
  top: 29px;
  left: 9px;
}
.option h2{
    margin: 16px 0px 10px 10px;
}
.option .bigbox{
    display: flex;
    justify-content: space-around;
}
.option .bigbox .name{
    font-size: 18px;
    font-weight: 500;
}
.option .hei{
    display: flex;
    justify-content: space-around;
    margin: 13px 0px;
}
.option .hei span{
    display: block;
    width: 23%;
    height: 30px;
    background-color: #eeecec;
    border-radius: 5px;
    text-align: center;
    line-height: 30px;
}
.option>.bigbox>.active{
    font-weight: 800;
    font-size: 18px;
}
.caidan{
    display: flex;
    justify-content: space-between;
}
.caidan .imgbox{
    width: 120px;
    height: 150px;
}
.caidan .imgbox .tu{
    width: 120px;
    height: 120px;
}
.caidan .jieshao{
    width: 300px;
    height: 130px;
}
.caidan .jieshao .ss .chao{
    width: 40px;
    height: 10px;
    background-color: rgba($color: #f0601d, $alpha: 0.5);
    margin: 5px 5px;
}
.caidan .jieshao .manjian span{
    border: solid 1px red;
    color: red;
    font-size: 12px;
    margin:5px 5px;
}



</style>
